#include "processbar.h"
#include<string.h>
#include<unistd.h>
#define length 101
#define style '#'
const char *label ="-/|\\";
void procBar()
{
  char bar[length];
  memset(bar,'\0',sizeof(bar));
  int cnt=0;
  while(cnt<=100)
  {
    printf("[%-100s]",bar);
    bar[cnt]=style;
    printf("[%3d%%][%c]\r",cnt,label[cnt%4]);
    fflush(stdout);
    usleep(20000);
    cnt++;
  }
  printf("\n");
}
